home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15684 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Copy Binary files to printer
  5. Date: 21 Apr 1996 05:01:59 GMT
  6. Organization: systems hk
  7. Message-ID: <4lcfg7$64r@nadine.teleport.com>
  8. References: <4l6s6u$3cg@news.accent.net>
  9. NNTP-Posting-Host: ip-pdx05-35.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. sgirouard@accent.net (Simon Girouard) wrote:
  16. >I am writing a C program that simulate the DOS "COPY /B" command but send
  17. >the file to a printer on a parallel port.
  18. [snip]
  19. >
  20. >The problem is that when writing to a file, it works fine but
  21. >when writing to the parrallele port "LPT1" it seems to have trouble
  22. >with the handshake and some garbage gets printed.
  23. >
  24. >Is there a way to fix this !
  25.  
  26. Simon,
  27.  
  28. I don't think the problem is as much with your program, as
  29. with the concept, assuming the subject 'Copy Binary files to
  30. printer' is correct.
  31.  
  32. If you copy all characters in a binary file to a printer
  33. (including non-text, unprintable, characters) you are likely
  34. to perform all manner of odd operations: resets, form-feeds,
  35. bells, change fonts, etc.  The printer is usually only
  36. expecting printable characters and a few printer-specific
  37. control-characters.
  38.  
  39. If you truly want to send a binary file to the printer,
  40. you will have to convert the unprintable characters
  41. into something more palatable (printable) first.
  42.  
  43. Yours, Geoff Houck
  44.  
  45.